


* Replication file for Van der Maat, Eelco. "Genocidal Consolidation: Final Solutions to Elite Rivalry," International Organization
* All analyses were done in Stata/IC 11.0 for Mac.

* This is the Stata replication of the third (leader fates) analysis; it contains:

	*replication of man analysis (Figure 4: leader fates; p 41)
	*replication of Rosenbaum sensitivity analysis (footnote 136 & 137)
	*replication of balance checks for various specifications Table A.7 of Appendix E
	*replication of leader propensity scores and matches (Table A.8 Tables and A.15�A.25)
	*replication of alternative specifications (Table A.9 of appendix E)
	*replication of balance checks for various HI specifications (Table A.12 of Appendix G)
	*replication of alternative specification with HI (Table A.14 of appendix G)




version 11.0
clear all
set mem 500m
capture log close
set more off



* set working directory
cd "/Users/eelco/Dropbox/Academic/Journal submissions/IO 2019/Final Manuscript/IO_GC_replication_III"


*log using "log", text replace


use  "leader_fates_data.dta", clear


* set random seed to repeat outcomes:

set seed 12345


*****************************************************************;
*   generate propensity score                    				 ; 	
*****************************************************************;


pscore genonset altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge,  pscore(pscore) numblo(5) level(.1) 


*****************************************************************;
*  Main analysis leader fates  .1 cal, n50                   	 ;
*                                                                ;
*  Figure 4, p 41, Average Treatment Effect of Genocidal         ;
*  Consolidation on Adverse Leader Fates.                        ;
*                                                                ;
*  Also, first column of Table A.9 of appendix E                 ;		
*****************************************************************;



* Death
psmatch2 genonset if dem==0, outcome(death) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(death) n(50) cal(.1) pscore(pscore) logit


* Imprisonment
psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.1) pscore(pscore) logit

* Exile

psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.1) pscore(pscore) logit


* External irregular exit
psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(pscore) logit


* Internal irregular exit
psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(pscore) logit


* Irregular exit (any)
psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(pscore) logit




*****************************************************************;
* rosenbaum sensitivity analysis        				         ;	
* footnote 136 and 137 on page 41        				         ;	
*****************************************************************;


gen difscore = .
* death gamma: 3.04 at 95 one-tailed aplpha
psmatch2 genonset if dem==0, outcome(death) cal(.1) n(50) pscore(pscore) logit
replace difscore = death - _death if _treat==1& _support==1
rbounds difscore,gamma(2.8(0.01)3.1) alpha(.95)
drop difscore

gen difscore = .
* prison gamma:  2.92 at 95 one-tailed aplpha
psmatch2 genonset if dem==0, outcome(prison) cal(.1) n(50) pscore(pscore) logit
replace difscore = prison - _prison if _treat==1 & _support==1
rbounds difscore,gamma(2.5(0.01)3) alpha(.95)
drop difscore

gen difscore = .
* internal exit  gamma: 1.48
psmatch2 genonset if dem==0, outcome(internal_x_yrs) cal(.1) n(50) pscore(pscore) logit
replace difscore = internal_x_yrs - _internal_x_yrs if _treat==1 & _support==1
rbounds difscore,gamma(1.3(0.01)1.5) alpha(.95)
drop difscore




*****************************************************************;
*   Table A.7 balance of various matching specifications         ;
*   Also, reprinted in Table A. 13                               ;		
*****************************************************************;

set more off
psmatch2 genonset if dem==0, outcome(death) radius cal(.01) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.02) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.05) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.1) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.05) n(50) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.1) n(50) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.2) n(50) pscore(pscore) logit
pstest altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge, both t(genonset) graph



*****************************************************************;
* leader matches and pscores.                                    ;
* Table A.8 of Appendix E.                                       ;
* Tables A.15�A.25 of Appendix.                     			 ;		
*****************************************************************;


psmatch2 genonset if dem==0, outcome(death) cal(.1) n(50) pscore(pscore) logit
sort _id
*list leader year if _id >=160 & _id <=209


unab xvars: _n1-_n50
local xarg : subinstr local xvars " " ",", all
generate xmax = max(`xarg')
generate xmin = min(`xarg')
list leader _pscore xmin xmax if xmax!=.

*Sindikubwabo .01767508      
list country leader year _pscore if _id >= 193 & _id <= 242


*Amin  .02237647      
list country leader year _pscore if _id >= 216 & _id <= 265



*Milosevic .03102081       
list country leader year _pscore if _id >= 241 & _id <= 290


*Gowon  .0462493      
list country leader year _pscore if _id >= 265 & _id <= 314


* Suharto  .05021121      
list country leader year _pscore  if _id >= 267 & _id <= 316


*Al-Bashir (.05465321)       
list country leader year _pscore  if _id >= 274 & _id <= 323


* Kayibanda .07333099            
list country leader year _pscore  if _id >= 291 & _id <= 340


* Pol Pot .0889992      
list country leader year _pscore  if _id >= 297 & _id <= 346


*  Micombero .1198589      
list country leader year _pscore if _id >= 306 & _id <= 355



* Mao Tse-Tung   .22531705      
list country leader year _pscore if _id >= 346 & _id <= 356



* unmatched controls
list country leader year _pscore if _id < 193




*****************************************************************;
*  Column II of Table A.9 of Appendix E   .05 cal, n50         	 ;		
*****************************************************************;

* these take a while; repeat set more off
set more off

* Death
psmatch2 genonset if dem==0, outcome(death) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(death) n(50) cal(.05) pscore(pscore) logit

* Imprisonment
psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.05) pscore(pscore) logit

* Exile
psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.05) pscore(pscore) logit

* External Irregular Exit
psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.05) pscore(pscore) logit

* Internal Irregular Exit
psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.05) pscore(pscore) logit

* Irregular Exit (any)
psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.05) pscore(pscore) logit



*****************************************************************;
*  Column III of Table A.9 of Appendix E, 3 years  .1 cal, n50   ;		
*****************************************************************;

* these take a while; repeat set more off
set more off

* Death
psmatch2 genonset if dem==0, outcome(death3yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(death3yrs) n(50) cal(.1) pscore(pscore) logit

* Imprisonment
psmatch2 genonset if dem==0, outcome(prison3yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(prison3yrs) n(50) cal(.1) pscore(pscore) logit

* Exile
psmatch2 genonset if dem==0, outcome(exile3) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(exile3) n(50) cal(.1) pscore(pscore) logit

* External Irregular Exit
psmatch2 genonset if dem==0, outcome(foreign_3_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(foreign_3_yrs) n(50) cal(.1) pscore(pscore) logit

* Internal Irregular Exit
psmatch2 genonset if dem==0, outcome(internal_3_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(internal_3_yrs) n(50) cal(.1) pscore(pscore) logit

* Irregular Exit (any)
psmatch2 genonset if dem==0, outcome(irreg_3_yrs) n(50) cal(.1) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(irreg_3_yrs) n(50) cal(.1) pscore(pscore) logit



*****************************************************************;
*  Column IV of Table A.9 of Appendix E, 3 years  .05 cal, n50   ;		
*****************************************************************;

* these take a while; repeat set more off
set more off

* Death
psmatch2 genonset if dem==0, outcome(death3yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(death3yrs) n(50) cal(.05) pscore(pscore) logit

* Imprisonment
psmatch2 genonset if dem==0, outcome(prison3yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(prison3yrs) n(50) cal(.05) pscore(pscore) logit

* Exile
psmatch2 genonset if dem==0, outcome(exile3yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(exile3yrs) n(50) cal(.05) pscore(pscore) logit

* External Irregular Exit
psmatch2 genonset if dem==0, outcome(foreign_3_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(foreign_3_yrs) n(50) cal(.05) pscore(pscore) logit

* Internal Irregular Exit
psmatch2 genonset if dem==0, outcome(internal_3_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(internal_3_yrs) n(50) cal(.05) pscore(pscore) logit

* Irregular Exit (any)
psmatch2 genonset if dem==0, outcome(irreg_3_yrs) n(50) cal(.05) pscore(pscore) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(irreg_3_yrs) n(50) cal(.05) pscore(pscore) logit




****************************************************************************
****************************************************************************
****                                                                    ****
****      Horizontal inequality                                         ****
****                                                                    ****
****************************************************************************
****************************************************************************



* use most at-risk observation per leader estimated with horizontal inequality
use  "leader_fates_HI_data.dta", clear



*****************************************************************;
*   generate propensity score with discriminate        			 ; 	
*****************************************************************;

pscore genonset altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge,  pscore(ps_alt) numblo(4) level(.1) 




*****************************************************************;
*   Table A.12 of Appendix G                                     ;
*   balance of various matching specifications with HI           ;		
*****************************************************************;


psmatch2 genonset if dem==0, outcome(death) radius cal(.01) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.02) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.05) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) radius cal(.1) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.05) n(50) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.1) n(50) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph

psmatch2 genonset if dem==0, outcome(death) cal(.2) n(50) pscore(ps_alt) logit
pstest altcoup_risk lgdppcl lpopl polity discriminate guerrilla tenure newleader2 Banks_purge, both t(genonset) graph





*****************************************************************;
*  Column II of Table A.14 of appendix G                    	 ;		
*****************************************************************;


* these take a while; repeat set more off
set more off

* Death
psmatch2 genonset if dem==0, outcome(death) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(death) n(50) cal(.1) pscore(ps_alt) logit

* Imprisonment
psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(prison) n(50) cal(.1) pscore(ps_alt) logit

* Exile
psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(exile) n(50) cal(.1) pscore(ps_alt) logit

* External Irregular Exit
psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(ps_alt) logit

* Internal Irregular Exit
psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(ps_alt) logit

* Irregular Exit (any)
psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(ps_alt) logit
bootstrap r(att), reps(5000): psmatch2 genonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(ps_alt) logit



*****************************************************************;
*   close log                                        			 ;		
*****************************************************************;

log close




****************************************************************************
****                                                                    ****
****      Placebo analysis. 
****      Figure 4 (A.1)      
****                                                                    ****
****************************************************************************


* note that I didn't set a seed originally so the standard errors differ slightly


use  "leader_fates_data.dta", clear



pscore cgvonset altcoup_risk lgdppcl lpopl polity guerrilla tenure newleader2 Banks_purge,  pscore(ps_cgv) numblo(5) level(.1) 


* Death
psmatch2 cgvonset if dem==0, outcome(death) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(death) n(50) cal(.1) pscore(ps_cgv) logit


* Imprisonment
psmatch2 cgvonset if dem==0, outcome(prison) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(prison) n(50) cal(.1) pscore(ps_cgv) logit

* Exile

psmatch2 cgvonset if dem==0, outcome(exile) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(exile) n(50) cal(.1) pscore(ps_cgv) logit


* External irregular exit
psmatch2 cgvonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(foreign_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit


* Internal irregular exit
psmatch2 cgvonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(internal_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit


* Irregular exit (any)
psmatch2 cgvonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit
bootstrap r(att), reps(5000): psmatch2 cgvonset if dem==0, outcome(irreg_x_yrs) n(50) cal(.1) pscore(ps_cgv) logit








